/* rqckalt.p  - REQUISITION APPROVAL - CHECK ALTERNATE                        */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/*V8:ConvertMode=NoConvert                                                    */
/* Revision: 8.6    LAST MODIFIED BY: 05/05/97  By: B. Gates          *J1Q2*  */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00 BY: *N0KP* myb                    */


/*!THIS PROCEDURE CHECKS IF THE ALTERNATE APPROVER IS AN IDENTIFIED ALTERNATE*/




         define input parameter p_approver like rqda_apr_userid no-undo.
         define input parameter p_alt_approver like rqda_apr_userid no-undo.
         define output parameter p_alternate_ok as log no-undo.

         {rqalttd.i} /*APPROVER LIST TEMPTABLE DEFINITIONS*/

         p_alternate_ok = true.

         find ttalt where ttalt_apr_userid = p_approver
         and ttalt_alt_userid = p_alt_approver no-lock no-error.

/* OBSOLETE CODE:  ALTERNATE APPROVERS ARE NOT REQUIRED TO BE SIMILAR TYPES
.        if available ttalt then do:
.           if ttalt_is_alt_apr = true
.           and ttalt_is_admin_apr = false
.           then do:
.              /*THIS ALTERNATE/ADMIN APPROVER IS AN ALTERNATE ONLY
.              WHICH MEANS THAT HE/SHE HAS TO BE A DEFINED APPROVER*/

.              find first ttcal where ttcal_apr_userid = ttalt_alt_userid
.              and
.              (
.                 ttcal_is_horizontal or ttcal_is_vertical
.                 or ttcal_is_job or ttcal_is_direct
.              )
.              no-lock no-error.

.              if not available ttcal then do:
.                 p_alternate_ok = false.
.              end.
.           end.
.        end.
.        else do:
.*/

         if not available ttalt then do:
            p_alternate_ok = false.
         end.
